export default store => {
  //console.log('store初始化了')
  //console.log(store初始化了)在每次store初始化时调用
  //if (localStorage.state) store.replaceState(JSON.parse(localStorage.state))  //如果本地有state，用replaceState方法替换掉store中的state
  store.subscribe((mutation, state) =>  { //每次提交mutation时，都会调用里面的回调函数
    //console.log('提交mutation')
    //localStorage.state = JSON.stringify(state)  //每次提交mutation时，将state里的数据存储到本地（用JSON.stringify，将state从对象转换成字符串）
  })
}
